import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class FloorRecommend extends StatelessWidget {
  List floorRecmmend;

  FloorRecommend(this.floorRecmmend);

  Widget _floorItem(BuildContext context, item) {
    return InkWell(
      onTap: () {
        print('object');
      },
      child: Container(
        color: Colors.blue,
        width: ScreenUtil().setWidth(185),
        height: ScreenUtil().setHeight(30),
        padding: EdgeInsets.all(3),
//        child: Image.network("https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2534506313,1688529724&fm=26&gp=0.jpg"),
        child: Image.network(item['image']),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      height: ScreenUtil().setHeight(800),
      child: GridView.count(
        physics: new NeverScrollableScrollPhysics(),
        crossAxisCount: 2,
        children: floorRecmmend.map((item) {
          return _floorItem(context,item);
        }).toList(),
      ),
    );
  }
}

class FloorTitle extends StatelessWidget {
  String titleImg;

  FloorTitle(this.titleImg);

  Widget _floorTitle() {
    return Container(
      padding: EdgeInsets.all(10),
      child: Image.network(titleImg),
    );
  }

  @override
  Widget build(BuildContext context) {
    return new Container(
      child: _floorTitle(),
    );
  }
}
